package com.apollographql.apollo;

import com.kt.Metadata;
import com.kt.jvm.internal.Intrinsics;
import okhttp3.Interceptor;
import okhttp3.Response;

import java.io.IOException;

@Metadata(bv = {1, 0, 3}, d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003¢\u0006\u0002\u0010\u0005J\u0010\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0016R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007R\u0011\u0010\u0004\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u0007¨\u0006\r"}, d2 = {"Lcom/apollographql/apollo/ApolloClientAwarenessInterceptor;", "Lokhttp3/Interceptor;", "clientName", "", "clientVersion", "(Ljava/lang/String;Ljava/lang/String;)V", "getClientName", "()Ljava/lang/String;", "getClientVersion", "intercept", "Lokhttp3/Response;", "chain", "Lokhttp3/Interceptor$Chain;", "apollo-runtime"}, k = 1, mv = {1, 4, 0})
/* compiled from: ApolloClientAwarenessInterceptor.kt */
public final class ApolloClientAwarenessInterceptor implements Interceptor {
    private final String clientName;
    private final String clientVersion;

    public ApolloClientAwarenessInterceptor(String clientName2, String clientVersion2) {
        Intrinsics.checkParameterIsNotNull(clientName2, "clientName");
        Intrinsics.checkParameterIsNotNull(clientVersion2, "clientVersion");
        this.clientName = clientName2;
        this.clientVersion = clientVersion2;
    }

    public final String getClientName() {
        return this.clientName;
    }

    public final String getClientVersion() {
        return this.clientVersion;
    }

    @Override // okhttp3.Interceptor
    public Response intercept(Chain chain) {
        Intrinsics.checkParameterIsNotNull(chain, "chain");
        Response proceed = null;
        try {
            proceed = chain.proceed(chain.request().newBuilder().addHeader("apollographql-client-name", this.clientName).addHeader("apollographql-client-version", this.clientVersion).build());
        } catch (IOException e) {
            e.printStackTrace();
        }
        Intrinsics.checkExpressionValueIsNotNull(proceed, "chain.proceed(newRequest)");
        return proceed;
    }
}
